﻿package mortal.game.net.command.guild
{
    import Framework.MQ.*;
    import Message.Command.*;
    import Message.Public.*;
    import mortal.game.cache.*;
    import mortal.game.mvc.*;
    import mortal.game.net.broadCast.*;
    import mortal.game.view.copy.guildDefenseCopy.*;
    import mortal.mvc.core.*;

    public class GuildDefenseCommand extends BroadCastCall
    {

        public function GuildDefenseCommand(param1:Object)
        {
            super(param1);
            return;
        }// end function

        override public function call(param1:MessageBlock) : void
        {
            var _loc_2:SGuildDefenseInfo = null;
            switch(param1.messageHead.command)
            {
                case EPublicCommand._ECmdPublicGuildDefenseOpen:
                {
                    Cache.instance.copy.guildDefence.guildDefenseOpenInfo = param1.messageBase as SGuildDefenseCopyInfo;
                    Cache.instance.copy.guildDefence.isOpenCopy = true;
                    NetDispatcher.dispatchCmd(ServerCommand.GuildDefenceCopyOpen, null);
                    break;
                }
                case EPublicCommand._ECmdPublicGuildDefenseEnd:
                {
                    Cache.instance.copy.guildDefence.difficult = Cache.instance.copy.guildDefence.guildDefenseOpenInfo.level;
                    Cache.instance.copy.guildDefence.isOpenCopy = false;
                    NetDispatcher.dispatchCmd(ServerCommand.GuildDefenceCopyEnd, null);
                    break;
                }
                case EPublicCommand._ECmdPublicGuildDefenseMemberReward:
                {
                    GuildDefenseCopyPassWin.instance.show();
                    GuildDefenseCopyPassWin.instance.updateInfo(param1.messageBase as SGuildDefenseMemberReward);
                    break;
                }
                case EPublicCommand._ECmdPublicGuildDefenseInfo:
                {
                    _loc_2 = param1.messageBase as SGuildDefenseInfo;
                    Cache.instance.copy.guildDefence.guildUpdateInfo = _loc_2;
                    NetDispatcher.dispatchCmd(ServerCommand.GuildDefenceInfoUpdate, _loc_2);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

    }
}
